const express = require('express');
const compression = require('compression');
const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const Log = require("./src/logger");
const GlobalPaths = require("./src/basic").GlobalPaths;
const Service = require("./src/service.js");

Log.Info("HTML server starting ...");

const _PORT = 8081;
this.mainApp = express();
this.mainApp.use(compression());
this.mainApp.use(express.static(GlobalPaths.ROOT_CLIENT));
this.mainApp.use(cookieParser('singedMyCookie'));
this.mainApp.post("/service", bodyParser.json({extended: false, limit: "1mb"}), Service.Serve);
this.mainApp.listen(_PORT, () => Log.Info(`SLOG HTTP server is now listening port: ${_PORT}`));



